package com.school.PersonalAddressBook;

import java.util.Scanner;

public class ContactManager {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        boolean running = true;

        while (running) {
            printMenu();
            int choice = scanner.nextInt();
            scanner.nextLine(); // Consume newline left-over

            switch (choice) {
                case 1:
                    System.out.println("查看联系人列表:"+"\n"+"张佳豪18381060060\nnyx1924501535\n" +
                            "");
                    // Implement list contacts functionality
                    break;
                case 2:
                    System.out.println("添加联系人");
                    // Implement add contact functionality
                    break;
                case 3:
                    System.out.println("修改联系人");
                    // Implement update contact functionality
                    break;
                case 4:
                    System.out.println("删除联系人");
                    // Implement delete contact functionality
                    break;
                case 6:
                    System.out.println("退出系统");
                    running = false;
                    break;
                default:
                    System.out.println("无效的选择，请重新输入！");
            }
        }

        scanner.close();
    }

    private static void printMenu() {
        System.out.println("这里是通讯簿管理系统");
        System.out.println("请选择您要访问的业务:");
        System.out.println("1: 查看");
        System.out.println("2: 添加");
        System.out.println("3: 修改");
        System.out.println("4: 删除");
        System.out.println("5: 退出");
    }
}